package Java实验.实验四;
import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String name = scanner.next();
        String birth = scanner.next();
        String position = scanner.next();
        double salary = scanner.nextDouble();
        Salary employee = new Salary(name, birth, position, salary);
        employee.introduction();
    }
}

/********** Begin *********/
class Employee {
    private String name;
    private String birth;
    private String position;

    public Employee(){}
    public Employee(String name,String birth,String position){
        this.name = name;
        this.birth = birth;
        this.position = position;
    }

    public String getName(){
        return name;
    }
    public String getBirth(){
        return birth;
    }
    public String getPosition(){
        return position;
    }
}

class Salary extends Employee {
    private double salary;
    public Salary(){}
    public Salary(String name,String birth,String position,double salary){
        super(name,birth,position);
        this.salary = salary;
    }

    public double getSalary(){
        return salary;
    }

    public void introduction(){
        System.out.println("员工姓名："+super.getName()+" "+"出生年月："+
                super.getBirth()+" "+"职位："+super.getPosition()+" "+"薪水："+getSalary());
    }
}
/********** End *********/
